package cn.bonoon.core.plugins;

import java.util.List;

import org.batatasframework.common.ParameterReader;

import cn.bonoon.entities.AccountEntity;
import cn.bonoon.entities.GroupAccountEntity;
import cn.bonoon.entities.GroupEntity;
import cn.bonoon.entities.RoleAccountEntity;
import cn.bonoon.entities.RoleEntity;
import cn.bonoon.kernel.support.IOperator;
import cn.bonoon.kernel.support.models.ObjectItem;

/**
 * 关于权限角色等分配的处理接口
 * @author jackson
 *
 */
public interface AccountAssignService {

	List<ObjectItem> roles(GroupEntity group);

	void saveGroupRoles(IOperator opt, Long aid, Long... roleIds);
	
	List<ObjectItem> roles(AccountEntity account);

	Object rolesByAccount(Long id);
	
	void saveAccountRoles(IOperator opt, Long aid, Long... roleIds);

	List<ObjectItem> groups(AccountEntity account);

	List<GroupEntity> groupsByAccount(Long id);
	
	void saveAccountGroups(IOperator user, Long id, Long... ids);

	List<ObjectItem> groups(RoleEntity role);

	void saveRoleGroups(IOperator user, Long id, Long... ids);

	List<GroupAccountEntity> accounts(GroupEntity group, int pageIndex);

	List<RoleAccountEntity> accounts(RoleEntity role, int pageIndex);

	List<RoleAccountEntity> searchRoleAccounts(ParameterReader parameter);

	List<GroupAccountEntity> searchGroupAccounts(ParameterReader parameter);

	List<RoleAccountEntity> deleteRoleAccounts(ParameterReader parameter);

	List<GroupAccountEntity> deleteGroupAccounts(ParameterReader parameter);

	List<RoleAccountEntity> saveRoleAccounts(ParameterReader parameter);

	List<GroupAccountEntity> saveGroupAccounts(ParameterReader parameter);


}
